//
//  NSObject+kit.m
//  chanlin
//
//  Created by Ryan on 14-11-1.
//  Copyright (c) 2014年 chanlin. All rights reserved.
//

#import "NSObject+kit.h"
#import "SgrSandbox.h"
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#import "CLBaseViewController.h"

@implementation NSObject (Kit)

- (NSString *)k_cacheUrl{
    return [SgrSandbox libCachePath];
}

- (UINavigationController *)k_rootController{
    return (UINavigationController *)(((AppDelegate *)[UIApplication sharedApplication].delegate).window.rootViewController);
}

- (UIWindow *)k_mainWindow{
    return ((AppDelegate *)[UIApplication sharedApplication].delegate).window;
}

- (CLBaseViewController *)k_currentController{
    return (CLBaseViewController *)[self k_rootController].topViewController;
}



@end
